<template>
  <div>
    <loading v-if="$store.state.bLoading"/>
    <app-header v-show="$store.state.bNav"/>
    <!-- <AppHeader/> -->
    <router-view/>
    <Footer v-show="$store.state.bFoot"/>
    
  </div>
</template>

<script>
  import AppHeader from '../components/header.vue'
  import Footer from '../components/footer.vue'
  import loading from '../components/loading.vue'
  export default {
    name:'app',
    props:{},
    components:{
      AppHeader,Footer,loading
    },
    watch:{
      $route(val){
        console.log('...',val.path);
        let path = val.path;
        let path2 = val.meta.path;
        if(/home|follow|column/.test(path)) {
          this.$store.commit('bNav',true)
          this.$store.commit('bFoot',true)
        }
        if(/login|reg/.test(path) || /detail/.test(path2)) {
          this.$store.commit('bNav',false)
          this.$store.commit('bFoot',false)
        }
        if(path.includes('user')){
         this.$store.commit('bNav',false)
         this.$store.commit('bFoot',true)
        }
      }
    },
    mounted(){},
    updated(){},
    methods:{},
    computed: {
    }
  }
</script>

<style scoped>
  .app{}
</style>
